﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Wicture.EPC.Service.V1.Filters
{
    public class UCStringSubaru : UCString
    {
        public UCStringSubaru(string bCode)
        {
            SetSympol('.', '-', '+');
            BuildBCode(bCode);
        }
        protected override bool MatchLeafNode(ISet<string> saCodes, string leafNode)
        {
            if(leafNode.EndsWith('#'))
            {
                leafNode = leafNode.Substring(0, leafNode.Length - 1);
                return saCodes.Any(q => q.StartsWith(leafNode));
            }
            else
            {
                return saCodes.Contains(leafNode);
            }
        }
    }
}
